<?php
/**
 *
 * @author Chashin Evgeniy
 */
class Log_Form_Settings extends Zen_Form
{
  
    public function init ()
    {
        // Вызываем родительский метод
        parent::init();
        
        $priorities = array(
	        Zend_Log::EMERG   => "Emergency: system is unusable",
		    Zend_Log::ALERT   => "Alert: action must be taken immediately",
		    Zend_Log::CRIT    => "Critical: critical conditions",
		    Zend_Log::ERR     => "Error: error conditions",
		    Zend_Log::WARN    => "Warning: warning conditions",
		    Zend_Log::NOTICE  => "Notice: normal but significant condition",
		    Zend_Log::INFO    => "Informational: informational messages",
		    Zend_Log::DEBUG   => "Debug: debug messages",
        );
        
        $email = new Zend_Form_Element_Text('email',
        array('required' => false ,
          'label' => 'Email адреса:' , 
          'class'=>'zend_text',
          'description'=>'Вводите адреса через запятую'
        ));
        $email->setFilters ( array ('StringTrim', 'StripTags'));
        
        $db_priority = Zen_Form_Element_Factory::getSelect('db_priority', true, 'Приоритет БД', $priorities, null);
        $db_priority->setValue(Zend_Log::NOTICE);
        
        $email_priority = Zen_Form_Element_Factory::getSelect('email_priority', true, 'Приоритет e-mail', $priorities, null);
        $email_priority->setValue(Zend_Log::CRIT);
        
		$this->addElements(array(
			$email,
			$db_priority,
			$email_priority,
			Zen_Form_Element_Factory::get('submit'),
		));
	    
    }
}